import type { RouteRecordRaw } from 'vue-router';
import RouterView from '@/layout/routerView/index.vue';
import menu from '@/assets/menuIcon/menu5.png';

const moduleName = 'equipment';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/equipment',
    name: moduleName,
    component: RouterView,
    redirect: '/equipment/tabulation',
    meta: {
      title: '仪器设备管理',
      icon: menu,
    },
    children: [
      {
        path: 'tabulation',
        name: `${moduleName}-tabulation`,
        component: () => import('@/views/equipment/tabulation/index.vue'),
        meta: {
          title: '仪器设备列表',
        },
      },
      {
        path: 'service',
        name: `${moduleName}-service`,
        component: () => import('@/views/equipment/service/index.vue'),
        meta: {
          title: '维修维保记录',
        },
      },
      {
        path: 'takeNotes',
        name: `${moduleName}-takeNotes`,
        component: () => import('@/views/equipment/takeNotes/index.vue'),
        meta: {
          title: '变动记录',
        },
      },
      {
        path: 'calibration',
        name: `${moduleName}-calibration`,
        component: () => import('@/views/equipment/calibration/index.vue'),
        meta: {
          title: '设备校准记录',
        },
      },
    ],
  },
];

export default routes;
